Java EE 8 Application Development by David R. Heffelfinger

Java EE 8 Application Development by David R. Heffelfinger
Author: David R. Heffelfinger
Language: eng
Format: epub, pdf
Tags: COM051280 - COMPUTERS / Programming Languages / Java, COM060180 - COMPUTERS / Web / Web Services and APIs, COM051000 - COMPUTERS / Programming / General
Publisher: Packt
Published: 2017-12-12

Summary


In this chapter, we provided an introduction to Contexts and Dependency Injection (CDI). We covered how JSF pages can access CDI named beans as if they were JSF managed beans. We also covered how CDI makes it easy to inject dependencies into our code via the @Inject annotation. Additionally, we explained how we can use qualifiers to determine which specific implementation of a dependency to inject into our code. Finally, we covered all the scopes that a CDI bean can be placed into, which include equivalents to all the JSF scopes, plus an additional two not included in JSF, namely, the conversation scope and the dependent scope.